package com.feihong.txgw.ui.activity.setting.webviewinterface;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.webkit.JavascriptInterface;

import com.feihong.txgw.ui.activity.setting.MessageListActivity;
import com.just.agentweb.AgentWeb;

/**
 * Created by PVer on 2017/8/17.
 */

public class MessagelistWebviewInterFace {

    private AgentWeb agent;
    private Context context;
    private String info = "";
    private MessageListActivity.ActionCallBack callBack;

    public MessagelistWebviewInterFace(AgentWeb agent, Context context,MessageListActivity.ActionCallBack callBack) {
        this.agent = agent;
        this.context = context;
        this.callBack = callBack;
    }

    private Handler deliver = new Handler(Looper.getMainLooper());
    //
    @JavascriptInterface
    public void go_list() {

        deliver.post(new Runnable() {
            @Override
            public void run() {

                if (callBack != null) {
                    callBack.go_list();
                }
            }
        });

        //对外接口
    }

    @JavascriptInterface
    public void kefu() {

        deliver.post(new Runnable() {
            @Override
            public void run() {

                if (callBack != null) {
                    callBack.kefu();
                }
            }
        });
        //对外接口
    }


}
